<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en"><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-15"><title>Apache JMeter
          -
          JMeter - User's Manual: LDAP Operations</title><meta name="viewport" content="width=device-width, initial-scale=1"><link href="http://fonts.googleapis.com/css?family=Merriweather:400normal" rel="stylesheet" type="text/css"><link rel="stylesheet" type="text/css" href="../css/new-style.css"></head><body role="document"><a href="#content" class="hidden">Main content</a><div class="header"><!--
            APACHE LOGO
          --><div><a href="http://www.apache.org"><img title="Apache Software Foundation" width="290" height="75" src="../images/asf-logo.png" alt="Logo ASF"></a></div><!--
              PROJECT LOGO
            --><div><a href="http://jmeter.apache.org/"><img src="../images/logo.jpg" alt="Apache JMeter"></a></div><div class="twitter"><div><a href="https://twitter.com/share" class="twitter-share-button" data-text="Powerful Load Testing with Apache #JMeter" data-via="ApacheJMeter" data-lang="en-gb" data-size="large">Tweet</a><script>
            (function(d,s,id){
              var js,
                  fjs=d.getElementsByTagName(s)[0],
                  p=/^http:/.test(d.location)?'http':'https';
              if (!d.getElementById(id)) {
                  js=d.createElement(s);
                  js.id=id;
                  js.src=p+'://platform.twitter.com/widgets.js';
                  fjs.parentNode.insertBefore(js,fjs);
              }
            })(document, 'script', 'twitter-wjs');
              </script></div><div><a href="https://twitter.com/ApacheJMeter" class="twitter-follow-button" data-show-count="false" data-lang="en-gb" data-size="large">Follow</a><script>(function(d,s,id){
                var js,
                    fjs=d.getElementsByTagName(s)[0],
                    p=/^http:/.test(d.location)?'http':'https';
                if (!d.getElementById(id)) {
                    js=d.createElement(s);
                    js.id=id;
                    js.src=p+'://platform.twitter.com/widgets.js';
                    fjs.parentNode.insertBefore(js,fjs);
                }
            })(document, 'script', 'twitter-wjs');
              </script></div></div><div class="banner"><iframe src="http://www.apache.org/ads/bannerbar.html" style="border-width:0;" frameborder="0" scrolling="no"></iframe><div class="clear"></div></div></div><div class="nav"><ul class="menu"><li><div class="menu-title">About</div><ul><li><a href="../index.html">Overview</a></li><li><a href="http://twitter.com/ApacheJMeter">JMeter on Twitter<img src="../images/twitter.png" alt="Icon for JMeter on Twitter"></a></li><li><a href="../issues.html">Issue Tracking</a></li><li><a href="http://projects.apache.org/feeds/rss/jmeter.xml">Subscribe to What's New</a></li><li><a href="http://www.apache.org/licenses/">License</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Download</div><ul><li><a href="../download_jmeter.cgi">Download Releases</a></li><li><a href="../nightly.html">Developer (Nightly) Builds</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Documentation</div><ul><li><a href="../changes.html">Changes per version</a></li><li><a href="../usermanual/get-started.html">Get Started</a></li><li><a href="../usermanual/index.html">User Manual</a></li><li><a href="../usermanual/best-practices.html">Best Practices</a></li><li><a href="../usermanual/component_reference.html">Component Reference</a></li><li><a href="../usermanual/functions.html">Functions Reference</a></li><li><a href="../api/index.html">Javadocs</a></li><li><a href="../building.html">Building JMeter and Add-Ons</a></li><li><a href="http://wiki.apache.org/jmeter">JMeter Wiki</a></li><li><a href="http://wiki.apache.org/jmeter/JMeterFAQ">FAQ (Wiki)</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Tutorials (PDF format)</div><ul><li><a href="../usermanual/jmeter_distributed_testing_step_by_step.pdf">Distributed Testing</a></li><li><a href="../usermanual/jmeter_proxy_step_by_step.pdf">Recording Tests</a></li><li><a href="../usermanual/junitsampler_tutorial.pdf">JUnit Sampler</a></li><li><a href="../usermanual/jmeter_accesslog_sampler_step_by_step.pdf">Access Log Sampler</a></li><li><a href="../extending/jmeter_tutorial.pdf">Extending JMeter</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Community</div><ul><li><a href="http://wiki.apache.org/jmeter/JMeterCommitters">Contributors</a></li><li><a href="../mail.html">Mailing Lists</a></li><li><a href="../svnindex.html">SVN Repositories</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Foundation</div><ul><li><a href="http://www.apache.org/">ASF</a></li><li><a href="http://www.apache.org/foundation/getinvolved.html">Get Involved in the ASF</a></li><li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li><li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li></ul></li></ul></div><div class="main" id="content"><div class="section"><h1 id="ops">A short LDAP Operations tutorial<a class="sectionlink" href="#ops" title="Link to here">&para;</a></h1>
    <p>
    The extended LDAP sampler was built to support testing for very complex testpurposes.
    It was aimed at supporting the LDAP operations as close as possible.
    In this short tutorial, I will explain which LDAP operations exist and what they do.
    Per operation, I will shortly explain how these operations are implemented.<br>
    LDAP servers are some kind of hierarchical database, they store objects (entries) in a tree. The uppermost part of a tree is called the ROOT of the tree.<br>
    eg. When a tree starts with dc=com, the root equals dc=com.<br>
    The next level can exist under the root, eg dc=test. The full name of this object (the "distinghuised name") is "dc=test,dc=com.<br>
    Again, a following level can be made, by adding the user "cn=admin" under dc=test,dc=com. This object has a DN (distinguished name) of "cn=admin,dc=test,dc=com".<br>
    The relative distinguished name (RDN) is the last part of the DN, eg. cn=admin.<br>
    The characteristics of an object are determined by the objectClasses, which can be seen as a collection of attributes.<br>
    The type of an object is determined by the "structural objectClass" eg person, organizationalUnit or country.<br>
    The attributes contain the data of an object, eg mailadress, name, streetadress etc. Each attribute can have 0, 1 or more values.
    </p>
<div class="subsection"><h2>1 Bind operation<a class="sectionlink" href="#bind" title="Link to here">&para;</a></h2>
    <p>
    Any contact with an LDAP server MUST start with a bind request. LDAP is a state dependent protocol. Without opening a session to
    a LDAP server, no additional request can be made.
    Due to some peculiarities in the JAVA libraries, 2 different bind operations are implemented.
    </p>
<div class="subsection"><h2>1.1 Thread Bind<a class="sectionlink" href="#thread_bind" title="Link to here">&para;</a></h2>
    <p>
    This bind is meant to open a session to a LDAP server. Any testplan should use this operation as the starting point from a session.
    For each Thread (each virtual user) a seperate connection with the LDAP server is build, and so a seperate Thread bind is performed.
    </p>
</div>
<div class="subsection"><h2>1.2 Single bind/unbind<a class="sectionlink" href="#single" title="Link to here">&para;</a></h2>
    <p>
        This bind is used for user authentication verification.
        A proper developed LDAP client, who needs an authenticated user, perform a bind with a given distinguished name and password.
        This Single bind/unbind operation is for this purpose. It builds it own seperate connection to the LDAP server, performs a
        bind operation, and ends the connection again (by sending an unbind).
    </p>
</div>
</div>
<div class="subsection"><h2>2 Unbind<a class="sectionlink" href="#unbind" title="Link to here">&para;</a></h2>
    <p>
        To close a connection to a LDAP server, an unbind operation is needed.
        As the Single bind/unbind operation already (implicitly) performs an unbind, only a Thread unbind operation is needed.
        This Thread unbind just closes the connection and cleans up any resources it has used.
    </p>
</div>
<div class="subsection"><h2>3 Compare<a class="sectionlink" href="#compare" title="Link to here">&para;</a></h2>
    <p>
    The compare operation needs the full distinguished name from a LDAP object, as well as a attribute and a value for the attribute.
    It will simply check: "Has this object really this attribute with this value?".
    Typical use is checking the membership of a certain user with a given group.
    </p>
</div>
<div class="subsection"><h2>4 Search<a class="sectionlink" href="#search" title="Link to here">&para;</a></h2>
    <p>
    The search test simply searches for all objects which comply with a given search filter, eg.
    all persons with a "employeeType=inactive" or "all persons with a userID equals user1"
    </p>
</div>
<div class="subsection"><h2>5 Add<a class="sectionlink" href="#add" title="Link to here">&para;</a></h2>
    <p>
    This simply add an object to the LDAP directory.
    Off course the combination of attributes and distinguishedName must be valid!
    </p>
</div>
<div class="subsection"><h2>6 Modify<a class="sectionlink" href="#modify" title="Link to here">&para;</a></h2>
    <p>
        This operation modifies one or more attributes from a given object.
        It needs the distinghised name from the object, as well as the attributes and the new values for this attribute.<br>
        Three versions are available, add, for adding an attribute value<br>
        replace, for overwriting the old attribute value with a new value<br>
        delete, to delete a value form an attribute, or to delete all the values of an attribute<br>
    </p>
</div>
<div class="subsection"><h2>7 Delete<a class="sectionlink" href="#delete" title="Link to here">&para;</a></h2>
    <p>
        This operation deletes an object from the LDAP server.
        It needs the distinghised name from the object.
    </p>
</div>
<div class="subsection"><h2>8 modDN<a class="sectionlink" href="#moddn" title="Link to here">&para;</a></h2>
    <p>
        This operation modifies the distinguished name from an object (it "moves" the object).<br>
        It comes in two flavours, just renaming an entry, then you specify a new RDN (relative distinguished name, this is the lowest part of the DN)<br>
        eg, you can rename "cn=admin,dc=test,dc=com" to cn=administrator,dc=test,dc=com"<br>
        The second flavour is renaming (moving) a complete subtree by specifying a "new superior"<br>
        eg you can move a complete subtree "ou=retired,ou=people,dc=test,dc=com" to a new subtree "ou=retired people,dc=test,dc=com" by specifying
        a new rdn "ou=retired people" and a new superior of "dc=test,dc=com"
    </p>
</div>
</div></div><div class="footer"><div class="copyright">
            Copyright &copy;
            1999 &ndash;
            2015
            , Apache Software Foundation
          </div><div class="trademarks">Apache, Apache JMeter, JMeter, the Apache
            feather, and the Apache JMeter logo are
            trademarks of the
            Apache Software Foundation.
          </div></div></body></html>